<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>微信授权登录</title>
    <style>
        .all {
            width: 100%;
            display: flex;
            margin-top: 100px;
            justify-content: center;
            align-items: center;
        }
        #grantBtn {
            border: 0;
            border-radius: 8px;
            background: red;
            width: 180px;
            line-height: 80px;
            color: #fff;
            font-size: 16px;
            text-align: center;
            cursor: pointer;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <div class="all">
        <button id="grantBtn" type="button">授权登录</button>
    </div>


    <script>
        const grantBtn = document.querySelector('#grantBtn');
        grantBtn.addEventListener('click', ()=>{
            window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa99dfef1b9cf149f&redirect_uri=https://9580tq6qa561.vicp.fun/api/mp/getCode&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
        },false);
    </script>
</body>
</html>